﻿using Hotel.BLL;
using Hotel.DAL;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace Hotel.API.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class AdminController : ControllerBase
    {
        public AdminController(AdminBLL adminBLL) 
        {
            AdminBLL = adminBLL;
        }

        public AdminBLL AdminBLL { get; }

        /// <summary>
        /// 管理员登录
        /// </summary>
        /// <param name="userName">管理员账号</param>
        /// <param name="userPwd">管理员密码</param>
        /// <returns></returns>
        [HttpGet]
        public IActionResult Login(string userName, string userPwd)
        {
            try
            {
                var res = AdminBLL.Login(userName, userPwd);
                return Ok(res);
            }
            catch (Exception)
            {

                throw;
            }
        }

        //加个注释，测试提交git
    }
}
